package com.extend_.ExtendsExercise;

/**
 * @Author 小闽
 * @Date 2024/8/9 21:54
 * @PackageName: com.extend_.ExtendsExercise
 * @ClassName: PC
 * @Description: 子类
 * @Version 1.0
 */
public class PC extends Computer {
    private String brand;
    // 构造器（无参）
    public PC(String cpu, int memory, int disk, String brand) {
        // 调用父类的构造器
        super(cpu, memory, disk);
        this.brand = brand;
    }
    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }
    public void printInfo(){
        System.out.println("PC信息=");
        System.out.println(getCpu() + getMemory() + getDisk());
        // 调用父类的返回信息的方法加上品牌
        System.out.println(getDetails() + "brand=" + brand);
    }
}
